package com.yg.item.controller;

import com.yg.item.pojo.ItemType;
import com.yg.item.pojo.vo.OneCategory;
import com.yg.item.service.CategoryService;
import com.yg.util.Result;
import com.yg.util.StatusCode;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/item")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;


    @ApiOperation(value = "查询分类列表",tags = "分类管理",httpMethod = "GET",code = 20000)
    @GetMapping("queryTransverse")
    public Result getCategory() {
        List<OneCategory> allCategory = categoryService.getAllCategory();

        return new Result(true, StatusCode.OK,"查询成功",allCategory);
    }
}
